﻿using System;

namespace PropertyExpression.TypedSqlBuilder.Test
{
    public static class SalesOrderHeaderProjectionExtensions
    {
        public static ISelect<SalesOrderHeaderProjection> ContactFirstName(
            this ISelect<SalesOrderHeaderProjection> it, IValue<string> value)
        {
            return it._(_ => _.ContactFirstName)(value);
        }
        public static ISelect<SalesOrderHeaderProjection> ProductName(
            this ISelect<SalesOrderHeaderProjection> it, IValue<string> value)
        {
            return it._(_ => _.ProductName)(value);
        }
        public static ISelect<SalesOrderHeaderProjection> OrderDate(
            this ISelect<SalesOrderHeaderProjection> it, IValue<DateTime> value)
        {
            return it._(_ => _.OrderDate)(value);
        }
    }

    public static partial class Schema
    {
        public static ISelect<SalesOrderHeaderProjection> SelectSalesOrderHeaderProjection(
            IValue<DateTime> orderDate)
        {
            return Query.Select<SalesOrderHeaderProjection>()
                ._(_ => _.OrderDate)(orderDate);
        }

        public static ISelect<SalesOrderHeaderOuterProjection> SelectSalesOrderHeaderOuterProjection(
            IValue<DateTime?> modifiedDate)
        {
            return Query.Select<SalesOrderHeaderOuterProjection>()
                ._(_ => _.ModifiedDate)(modifiedDate);
        }
    }
}
